package com.yunji.cabinet.service;

import com.yunji.base.bo.ChangeBindBO;
import com.yunji.cabinet.bo.*;
import com.yunji.cabinet.domain.ContainerDO;
import com.yunji.cabinet.domain.ContainerScanDO;
import com.yunji.cabinet.params.SpecificUpgradeCabinetParam;
import com.yunji.cabinet.vo.SpecificUpgradeCabinetVO;
import com.yunji.common.model.cache.CabinetCacheDTO;
import com.yunji.common.model.domain.SiteDO;
import com.yunji.storage.dto.StorageFiledDTO;

import java.util.List;

/**
 * @version 1.0
 * @Project: yunji-coffee
 * @Package com.yunji.cabinet.service
 * @FileName ICabinetService.java
 * @Copyright Copyright © 2024 云集互联. All Rights Reserved
 * Company		com
 * @CreateTime 2024-04-09 13:40:35
 * @Description 货柜接口
 * @Modification Author                    History Time			Version				Description
 * --------------------------------------------------------------------------------
 * HuaAo				2024-04-09 13:40:35		1.0					1.0 Version
 * @since JDK 1.8.0_202
 */
public interface ICabinetService {

    ContainerScanDO getScanMsg(String scanId);

    boolean saveOrUpdateScanMsg(ContainerScanDO domain);

    List<CabinetBO> searchList(CabinetListQueryBO param);

    CabinetBO select(Long cabinetId);

    ContainerDO getById(Long cabinetId);

    CabinetBO select(CabinetSelectQueryBo bo);

    /**
     * @return boolean 新增结果
     * @Title create
     * @Desc 创建货柜信息
     * @Date 2024-04-08 16:52:16
     * @Param cabinet 货柜信息
     */
    boolean create(ContainerDO cabinet);

    /**
     * @return boolean 修改结果
     * @Title update
     * @Desc 修改货柜
     * @Date 2024-04-08 16:55:09
     * @Param cabinet 货柜信息
     */
    boolean update(ContainerDO cabinet);

    /**
     * @param
     * @Title changeAgent
     * @Desc 更换代理
     * @Date 2024-09-13 19:32:01.212
     * @Return boolean 修改结果
     */
    boolean changeAgent(ChangeBindBO bo);

    /**
     * @param ids 货柜ID数组
     * @Title delete
     * @Desc 删除货柜信息
     * @Date 2024-06-07 16:38:45.317
     * @Return boolean 删除结果
     */
    boolean delete(Long... ids);

    /**
     * @param
     * @Title checkCabinet
     * @Desc 检验货柜是否占用
     * @Date 2024-06-07 16:35:37.390
     * @Return boolean true 不占用 false 占用
     */
    boolean checkCabinet(CabinetCheckBO bo);

    /**
     * @Title resetQRCode
     * @Desc 重置货柜二维码信息
     * @Date 2024-06-07 16:21:27.659
     * @Return boolean 重置结果
     */
    boolean resetCabinetQrcode(Long cabinetId);

    /**
     * @Title agentCabinetCount
     * @Desc 代理货柜统计
     * @Date 2024-09-02 11:59:01.290
     * @Return int 统计结果
     */
    int countCabinet(CabinetCountBO bo);

    /*-----------------------------------搜索栏-----------------------------*/

    /**
     * @param param 过滤条件
     * @Title searchTableField
     * @Desc 匹配表字段信息
     * @Date 2024-09-09 11:40:46.462
     * @Return List<String> 匹配结果
     */
    List<String> searchTableField(StorageFiledDTO param);

    /**
     * @Title searchContainerProduct
     * @Desc 查询货柜商品
     * @Date 2024-09-19 10:37:18.291
     * @Return List<Product>
     */
    List<Long> searchProductIdsBySiteId(Long siteId);

    SiteDO getSiteByCid(Long containerId);

    Long getBelongIdByContainerId(Long containerId);

    String getImeiByQrcode(String qrcode);

    String getImeiById(Long id);

    List<ContainerDO> search(CabinetListQueryBO bo);

    ContainerDO getByQrcode(String qrCode);

    List<SpecificUpgradeCabinetVO> specificUpgradeCabinetVOList(SpecificUpgradeCabinetParam param);

    List<ContainerDO> specificUpgradeCabinetList(SpecificUpgradeCabinetBO bo);

    boolean containerExistsSiteLocation(List<Long> locationIds);

    boolean exist(CabinetSelectQueryBo build);

    CabinetCacheDTO getCacheByImei(String imei);
}
